#-------------------------------------------------
#
# Project created by QtCreator 2012-05-14T15:39:28
#
#-------------------------------------------------

# Major and Minor Number to be used for target name
# Change here if necessary
#
MAJOR = 0
MINOR = 8

# uncomment to run doxygen on release build
#
#CONFIG += do_doxygen

# uncomment to update .ts file(s)
#
CONFIG += do_tsupdate
TRANSLATIONS = PlacesParser_en.ts

# codec settings
#
CODECFORSRC = UTF-8
windows:CODECFORTR = Latin1
unix:CODECFORTR = UTF-8

# set dirs
#
NSS_WINLIB =	    $$PWD/../lib/nss-3.11/lib
NSS_INCLUDES =	    $$PWD/../include/nss-3.11
NSPR_WINLIB =	    $$PWD/../lib/nspr-4.6.1/lib
NSPR_INCLUDES =	    $$PWD/../include/nspr-4.6.1/
SQLITE_WINLIB =	    $$PWD/../lib/sqlite3
SQLITE_INCLUDES =   $$PWD/../sqlite3

# Include common settings
#
!include( ../PlacesParserCommon.pri) {
    error( Cannot find PlacesParserCommon.pri file! )
}

# Generating Version number on eyery build
#
windows:VERSIONPROG = $$PWD/../tools/version.exe
unix:VERSIONPROG = $$PWD/../tools/version

VERSION_HEADER = ../PlacesParser/version.h
!exists($$VERSIONPROG):error("$$VERSIONPROG existiert nicht.")
!exists($$VERSION_HEADER):message("\'version.h\' existiert nicht. Generating ...")
!exists($$VERSION_HEADER) {
    VER = $$system($$VERSIONPROG $$MAJOR $$MINOR $$VERSION_HEADER)
}

QMAKE_EXTRA_TARGETS += revtarget
PRE_TARGETDEPS      += $$VERSION_HEADER
revtarget.target     = $$VERSION_HEADER
revtarget.commands = $$VERSIONPROG $$MAJOR $$MINOR $$VERSION_HEADER
revtarget.depends = FORCE
QMAKE_DISTCLEAN += $$revtarget.target

VER = $$system($$VERSIONPROG $$MAJOR $$MINOR $$VERSION_HEADER)

# Start of PlacesParser Settings
#
QT          += core gui
TARGET      = PlacesParser
TEMPLATE    = app
CONFIG      += warn_on no_keywords

# Configure Files
#
SOURCES += main.cpp\
	mainwindow.cpp \
	sqlitedb.cpp \
	dbtreeview.cpp \
	sqldlg.cpp \
	searchthread.cpp \
	searchdlg.cpp \
	decryptdlg.cpp \
	extdevice.cpp \
	extdevicedlg.cpp \
	timeconvdlg.cpp \
    providerdlg.cpp \
    binaryviewwidget.cpp \
    parsethread.cpp

HEADERS += mainwindow.h \
	version.h \
	sqlitedb.h \
	dbtreeview.h \
	defines.h \
	sqldlg.h \
	searchthread.h \
	searchdlg.h \
	decryptdlg.h \
	extdevice.h \
	extdevicedlg.h \
	timeconvdlg.h \
    providerdlg.h \
    binaryviewwidget.h \
    parsethread.h

FORMS += mainwindow.ui \
	sqldlg.ui \
	searchdlg.ui \
	decryptdlg.ui \
	timeconvdlg.ui \
    providerdlg.ui \
    binaryviewwidget.ui

RC_FILE = placesparser.rc

RESOURCES += resources.qrc

OTHER_FILES += firefox_blue.ico \
		../copy_release.bat \
		../PlacesParserCommon.pri \
		../tools/copy_release.bat \
		../tools/get_revision.bat \
		../tools/copy_release.sh \
		../tools/get_revision.sh \
		README.txt \
		Doxyfile.conf \
		AppLogo4Doxy.jpg \
		database.ico \
		placesparser.rc \
		pastebin.txt \
		res/128_Database_3.png \
		res/64_Database_3.png \
		res/64_Database_3.ico \
		res/run_24.png \
		res/delete_24.png \
		res/database_3.svg \
		res/reload_24.png \
		res/openfolder_24.png \
		PlacesParser_en.ts \
		../templates/telephony.db.tpl \
		../templates/signons.sqlite.tpl \
		../templates/PPSettings.ini \
		../templates/places.sqlite.tpl \
		../templates/mmssms.db.tpl \
		../templates/downloads.sqlite.tpl \
		../tools/translate.bat \
    res/sm-success.png \
    res/sm-failed.png \
    res/sm-alertO.png \
    res/hexview_32.png

# Configure Output Dirs
#
CONFIG(debug, debug|release) {
    DESTDIR = "$$PWD/../bin/debug"
}
CONFIG(release, debug|release) {
    DESTDIR = "$$PWD/../bin/release"
}

# Include Libraries
#
INCLUDEPATH += $$SQLITE_INCLUDES
DEPENDPATH  += $$SQLITE_INCLUDES
INCLUDEPATH += $$PWD/../include/pstreams-0.7.0
DEPENDPATH  += $$PWD/../include/pstreams-0.7.0

windows {
    INCLUDEPATH += $$PWD/../include/nss-3.11
    DEPENDPATH  += $$PWD/../include/nss-3.11
    INCLUDEPATH += $$PWD/../include/nspr-4.6.1
    DEPENDPATH  += $$PWD/../include/nspr-4.6.1
}
unix {
    INCLUDEPATH += /usr/include/nss
    INCLUDEPATH += /usr/include/nspr
}

# libraries debug|release windows
#
# nss libs windows
windows {
    LIBS += -L$$PWD/../lib/nss-3.11/lib/ -lnss3
    PRE_TARGETDEPS += $$PWD/../lib/nss-3.11/lib/nss3.lib
    LIBS += -L$$PWD/../lib/nss-3.11/lib/ -lssl3
    PRE_TARGETDEPS += $$PWD/../lib/nss-3.11/lib/ssl3.lib
    LIBS += -L$$PWD/../lib/nss-3.11/lib/ -lsmime3
    PRE_TARGETDEPS += $$PWD/../lib/nss-3.11/lib/smime3.lib
# nspr libs windows
    LIBS += -L$$PWD/../lib/nspr-4.6.1/lib/ -llibnspr4
    PRE_TARGETDEPS += $$PWD/../lib/nspr-4.6.1/lib/libnspr4.lib
    LIBS += -L$$PWD/../lib/nspr-4.6.1/lib/ -llibplc4
    PRE_TARGETDEPS += $$PWD/../lib/nspr-4.6.1/lib/libplc4.lib
    LIBS += -L$$PWD/../lib/nspr-4.6.1/lib/ -llibplds4
    PRE_TARGETDEPS += $$PWD/../lib/nspr-4.6.1/lib/libplds4.lib
}

# nss libs unix systemwide
unix {
    LIBS += -lnss3
    LIBS += -lssl3
    LIBS += -lsmime3
# nspr libs unix systemwide
    LIBS += -lnspr4
    LIBS += -lplc4
    LIBS += -lplds4
}


# libraries release windows
#
windows:CONFIG(release, debug|release){
    # sqlite3 lib
    LIBS += -L$$SQLITE_WINLIB/release/ -lsqlite3
#    PRE_TARGETDEPS += $$SQLITE_WINLIB/release/sqlite3.lib

    QMAKE_PRE_LINK += lupdate PlacesParser.pro
    QMAKE_POST_LINK += $$PWD/../tools/copy_release.bat $$VER
    do_tsupdate:QMAKE_POST_LINK += $$PWD/../tools/translate.bat
    do_doxygen:QMAKE_POST_LINK += ( type "$$PWD/PlacesParser/Doxyfile.conf" && echo "PROJECT_NUMBER=$$VER" ) | doxygen.exe -
}
# libraries debug windows
#
else:windows:CONFIG(debug, debug|release){
    # sqlite3 lib
    LIBS += -L$$SQLITE_WINLIB/debug/ -lsqlite3
    PRE_TARGETDEPS += $$SQLITE_WINLIB/debug/sqlite3.lib
    do_tsupdate:QMAKE_POST_LINK += $$PWD/../tools/translate.bat
}

# libraries release unix
#
unix:CONFIG(release, debug|release){
    LIBS += -L$$PWD/../lib/sqlite3/release/ -lsqlite3
    PRE_TARGETDEPS += $$PWD/../lib/sqlite3/release/libsqlite3.a
    QMAKE_PRE_LINK += lupdate PlacesParser.pro
    QMAKE_POST_LINK += $$PWD/../tools/copy_release.sh $$VER
    do_doxygen:QMAKE_POST_LINK += ( type "$$PWD/PlacesParser/Doxyfile.conf" && echo "PROJECT_NUMBER=$$VER" ) | doxygen -
}
# libraries debug unix
#
else:unix:CONFIG(debug, debug|release){
    LIBS += -L$$PWD/../lib/sqlite3/debug/ -lsqlite3
    PRE_TARGETDEPS += $$PWD/../lib/sqlite3/debug/libsqlite3.a
    do_tsupdate:QMAKE_PRE_LINK += lupdate PlacesParser.pro
#    QMAKE_PRE_LINK += lrelease PlacesParser_en.tr
}


